let formValidate = {
  data(){
    let numberValidator = (rule,value,callback) => {
      if(value===''){
        return callback(new Error(this.$t('m.enter')+this.$t('m.page.partition')+this.$t('m.code')))
      } else if(isNaN(value)){
        return callback(new Error(this.$t('m.partition.partitionCodeValidate')))
      } else if(value<0){
        return callback(new Error(this.$t('m.enter')+this.$t('m.check.number0')))
      }
      callback()
    }
    return {
      ruleForm:{
        partitionname:[{ required:true, message:this.$t('m.enter')+this.$t('m.page.partition')+this.$t('m.name'), trigger:'blur'}],
        partitioncode:[{ required:true, validator:numberValidator, trigger:'blur' }],
        typevalueid:[{ required:true, message:this.$t('m.choose')+this.$t('m.type'), trigger:'change'}],
        isshelves:[{ required:true, message:this.$t('m.choose')+this.$t('m.partition.isshelves'), trigger:'change'}],
        orderno:[{ required:true, message:this.$t('m.enter')+this.$t('m.sortNumber'), trigger:'blur'}]
      }
    }
  }
}
export {formValidate}